package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
* @author zf
* @date 2021-07-10
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("appraisal")
public class Appraisal implements Serializable {

    @TableId
    private Integer id;


    /** 地址 */
    private String address;


    /** 用户openID */
    private String openId;


    /** 小区 */
    private String community;


    /** 房栋楼号 */
    private String buildingNumber;


    /** 朝向 */
    private String towards;


    /** 房屋面积 */
    private String area;


    /** 装修风格 */
    private String decoration;


    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createTime;


    public void copy(Appraisal source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
